﻿using BCDto.WebSocketComponent;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace BCWebSocket.Custom
{
    /// <summary>
    /// websocket客服服务接口
    /// </summary>
    public interface IWebSocketCustomService
    {
        /// <summary>
        /// 操作处理
        /// </summary>
        /// <param name="requestContent">请求内容</param>
        /// <returns></returns>
        WebSocketResponseDto OperationHandle(WebSocketRequestDto requestContent);
        /// <summary>
        /// 循环回波请求处理方法
        /// </summary>
        /// <param name="requestContent">请求内容</param>
        /// <returns></returns>
        WebSocketResponseDto ContentHandle(WebSocketRequestDto requestContent);
        /// <summary>
        /// 留言
        /// </summary>
        /// <param name="webSocketRequestDto">请求内容</param>
        /// <returns></returns>
        WebSocketResponseDto LeaveMessage(WebSocketRequestDto webSocketRequestDto);

        /// <summary>
        /// 重新分配客服
        /// </summary>
        /// <param name="concurrentDictionary">WebSocket存储容器</param>
        /// <param name="adminId">员工Id</param>
        void RedistributeCustom(ConcurrentDictionary<string, WebSocketUserDto> concurrentDictionary, string adminId);

        /// <summary>
        /// 客服上线
        /// </summary>
        /// <param name="concurrentDictionary">WebSocket存储容器</param>
        /// <param name="adminId">员工Id</param>
        void Online(ConcurrentDictionary<string, WebSocketUserDto> concurrentDictionary, string adminId);
        /// <summary>
        /// 接待用户下线
        /// </summary>
        /// <param name="concurrentDictionary">WebSocket存储容器</param>
        /// <param name="receptionUser">接待用户</param>
        /// <param name="isError">是否返回异常错误</param>
        void Offline(ConcurrentDictionary<string, WebSocketUserDto> concurrentDictionary, string receptionUser,bool isError);
        /// <summary>
        /// 用户触发客服不在线
        /// </summary>
        /// <param name="adminId">员工Id</param>
        void CustomOffline(string adminId);
    }
}
